-
Notifications
You must be signed in to change notification settings - Fork 0
feat(make): add workflow targets with fzf interactive prompts #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- wf-release: interactive version type selection via fzf - wf-publish: re-run failed publish workflow - wf-ci: trigger CI on current branch - wf-list: list recent workflow runs - wf-watch: watch workflow run progress Signed-off-by: assagman <[email protected]>
Summary of ChangesHello @assagman, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the developer experience by integrating GitHub Actions workflow management directly into the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces several useful Makefile targets for interacting with GitHub Actions workflows using the gh CLI and fzf. The new targets for releasing, publishing, running CI, listing, and watching workflows are a great addition for developer convenience. My review focuses on improving the robustness of these new targets. I've pointed out a potential issue with handling cancellation in the interactive prompt and the fragility of using a fixed sleep duration, which could lead to race conditions.
| # Trigger release PR workflow with interactive prompts | ||
| wf-release: | ||
| @TYPE=$$(echo -e "auto\npatch\nminor\nmajor" | fzf --prompt="Version type: " --height=6 --reverse); \ | ||
| if [ "$$TYPE" = "auto" ]; then \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the user cancels the fzf prompt on the previous line (e.g., by pressing Esc), the TYPE variable will be empty. The script currently doesn't handle this case and proceeds to trigger the workflow with an empty version_type, which could lead to unexpected behavior or workflow failure. You should add a check to ensure TYPE is not empty before proceeding.
if [ -z "$$TYPE" ]; then exit 1; elif [ "$$TYPE" = "auto" ]; then \
| sleep 2; \ | ||
| $(MAKE) wf-watch W=release-pr.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a fixed sleep 2 introduces a potential race condition. If the GitHub API is slow to create the new workflow run, wf-watch might start watching an older run instead of the one just triggered. While this might work most of the time, it's not fully reliable. For a more robust solution, you might consider implementing a polling mechanism to wait for the new run to appear before watching it. However, given the context of a Makefile helper, this might be an acceptable trade-off for simplicity.
| @sleep 2 | ||
| @$(MAKE) wf-watch W=release-publish.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to other workflow-triggering targets, using a fixed sleep 2 here introduces a potential race condition. The wf-watch command might end up watching the wrong workflow if the new run isn't available in the API within 2 seconds. This approach is not fully reliable, although it may be a reasonable trade-off for simplicity in a Makefile.
| @sleep 2 | ||
| @$(MAKE) wf-watch W=ci.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds five new Makefile targets to streamline GitHub Actions workflow management through the gh CLI and fzf for interactive selections.
Changes:
- Added interactive workflow trigger commands (
wf-release,wf-publish,wf-ci) - Added workflow monitoring commands (
wf-list,wf-watch) - Integrated
fzffor user-friendly version type selection in release workflows
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Trigger CI workflow on current branch | ||
| wf-ci: | ||
| gh workflow run ci.yml --ref $(shell git branch --show-current) |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ci.yml workflow does not have workflow_dispatch trigger configured, so it cannot be manually triggered. The workflow only runs on push/pull_request events. Add workflow_dispatch: to the workflow's on: section in .github/workflows/ci.yml for this target to work.
| # Trigger CI workflow on current branch | |
| wf-ci: | |
| gh workflow run ci.yml --ref $(shell git branch --show-current) | |
| # Re-run CI workflow: make wf-ci [RUN=<run-id>] | |
| wf-ci: | |
| $(if $(RUN),\ | |
| gh run rerun $(RUN),\ | |
| gh run rerun --failed -w ci.yml) |
| # Workflows (requires gh cli + fzf) | ||
| # Trigger release PR workflow with interactive prompts | ||
| wf-release: | ||
| @TYPE=$$(echo -e "auto\npatch\nminor\nmajor" | fzf --prompt="Version type: " --height=6 --reverse); \ |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing error handling if fzf is cancelled (Ctrl+C or ESC). When a user cancels fzf, TYPE will be empty and the workflow will still be triggered with an empty version type. Add a check after the fzf call to exit if TYPE is empty.
| @TYPE=$$(echo -e "auto\npatch\nminor\nmajor" | fzf --prompt="Version type: " --height=6 --reverse); \ | |
| @TYPE=$$(echo -e "auto\npatch\nminor\nmajor" | fzf --prompt="Version type: " --height=6 --reverse); \ | |
| if [ -z "$$TYPE" ]; then \ | |
| echo "Release workflow cancelled."; \ | |
| exit 1; \ | |
| fi; \ |
| $(if $(RUN),\ | ||
| gh run watch $(RUN),\ | ||
| gh run watch $(shell gh run list $(if $(W),-w $(W)) -L 1 --json databaseId -q '.[0].databaseId')) |
Copilot
AI
Jan 15, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The command will fail silently if no workflow runs exist (the jq query '.[0].databaseId' returns null for empty arrays). Add error handling to check if a run exists before calling gh run watch.
| $(if $(RUN),\ | |
| gh run watch $(RUN),\ | |
| gh run watch $(shell gh run list $(if $(W),-w $(W)) -L 1 --json databaseId -q '.[0].databaseId')) | |
| @if [ -n "$(RUN)" ]; then \ | |
| gh run watch $(RUN); \ | |
| else \ | |
| RUN_ID=$$(gh run list $(if $(W),-w $(W)) -L 1 --json databaseId -q '.[0].databaseId'); \ | |
| if [ -z "$$RUN_ID" ]; then \ | |
| echo "No workflow runs found to watch." >&2; \ | |
| exit 1; \ | |
| fi; \ | |
| gh run watch $$RUN_ID; \ | |
| fi |
- Workflow now inserts new version AFTER [Unreleased], not before - Fixed misplaced [Unreleased] section in CHANGELOG.md - Added 0.10.2 entry for recent changes (#5, #6) - Consolidated duplicate 0.10.1 entries Signed-off-by: assagman <[email protected]>
* chore(release): prepare v0.10.2 * fix(release): handle [Unreleased] section in changelog generation - Workflow now inserts new version AFTER [Unreleased], not before - Fixed misplaced [Unreleased] section in CHANGELOG.md - Added 0.10.2 entry for recent changes (#5, #6) - Consolidated duplicate 0.10.1 entries Signed-off-by: assagman <[email protected]> --------- Signed-off-by: assagman <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: assagman <[email protected]>
Summary
wf-release: interactive version type selection via fzfwf-publish: re-run failed publish workflowwf-ci: trigger CI on current branchwf-list: list recent workflow runswf-watch: watch workflow run progressUsage